<include target="./common_header.html" />
<load target="filter/delete_checked_message.xml" />
<load target="filter/update_allow_message.xml" />
<div class="btnArea">
	<form action="./" method="GET" style="margin:0;display:inline-block;*display:inline;zoom:1" onsubmit="location.href=current_url.setQuery('message_srl','').setQuery('message_type',this.message_box.options[this.message_box.selectedIndex].value); return false;">
		<select name="message_box" style="margin:0">
			<option loop="$lang->message_box => $key,$val" selected="selected"|cond="$key==$message_type" value="{$key}" >{$val}</option>
		</select>
		<input type="submit" value="{$lang->cmd_select}" class="btn" />
	</form>
	<form action="./" method="POST" style="margin:0;display:inline-block;*display:inline;zoom:1">
		<input type="hidden" name="module" value="communication" />
		<input type="hidden" name="act" value="procCommunicationUpdateAllowMessage" />
		<input type="hidden" name="message_type" value="{$message_type}" />
		<select name="allow_message" style="margin:0">
			<option loop="$lang->allow_message_type => $key,$val" value="{$key}" selected="selected"|cond="$logged_info->allow_message==$key">{$val}</option>
		</select>
		<input type="submit" value="{$lang->cmd_save}" class="btn">
	</form>
</div>
<table class="table table-striped table-hover" cond="$message">
	<tr>
		<th>{$message->title}</th>
	</tr>
	<tr>
		<td>
			<a href="popup_menu_area" class="member_{$message->member_srl}">{$message->nick_name}</a>
			{zdate($message->regdate, "Y.m.d H:i")}
		</td>
	</tr>
	<tr>
		<td class="xe_content">
			{$message->content}
		</td>
	</tr>
</table>
<div class="btnArea btn-group" cond="$message" style="margin-bottom:20px">
	<button class="btn" cond="$message->message_type != 'S' && $message->member_srl != $logged_info->member_srl" type="button" onclick="doSendMessage('{$message->sender_srl}','{$message->message_srl}');">{$lang->cmd_reply_message}</button>
	<button class="btn" cond="$message->message_type == 'R'" type="button" onclick="doStoreMessage('{$message->message_srl}');">{$lang->cmd_store}</button>
	<button class="btn" type="button" onclick="doDeleteMessage('{$message->message_srl}');">{$lang->cmd_delete}</button>
</div>

<form action="./" method="get" id="fo_message_list">
	<input type="hidden" name="module" value="communication" />
	<input type="hidden" name="act" value="procCommunicationDeleteMessages" />
	<input type="hidden" name="message_type" value="{$message_type}" />
	<table class="table table-striped table-hover">
		<thead>
			<tr>
				<th scope="col" class="title">{$lang->title}</th>
				<th scope="col">
					<!--@if($message_type == "S")-->
					{$lang->receiver}
					<!--@else-->
					{$lang->sender}
					<!--@end-->
				</th>
				<th scope="col">{$lang->regdate}</th>
				<th scope="col">{$lang->readed_date}</th>
				<th scope="col"><input name="check_all" type="checkbox" onclick="XE.checkboxToggleAll('message_srl_list[]', {wrap:'fo_message_list'})"/></th>
			</tr>
		</thead>
		<tbody>
			<tr loop="$message_list => $no,$val">
				<td class="title">
					<a cond="$val->readed=='Y'" href="{getUrl('message_srl',$val->message_srl)}">{$val->title}</a>
					<a cond="$val->readed!='Y'" href="{getUrl('message_srl',$val->message_srl)}"><strong>{$val->title}</strong></a>
				</td>
				<td>
					<a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a>
				</td>
				<td> 
					{zdate($val->regdate,"Y-m-d")}
				</td>
				<td><block cond="$val->readed=='Y'">{zdate($val->readed_date,"Y-m-d H:i")}</block>&nbsp;</td>
				<td><input name="message_srl_list[]" type="checkbox" value="{$val->message_srl}" /></td>
			</tr>
		</tbody>
	</table>
	<div class="btnArea">
		<input type="submit" class="btn" value="{$lang->cmd_delete}" />
	</div>
</form>
<div class="pagination pagination-centered">
	<ul>
		<li><a href="{getUrl('page','','document_srl','')}" class="direction">&laquo; {$lang->first_page}</a></li>
		<!--@while($page_no = $page_navigation->getNextPage())-->
		<li class="active"|cond="$page == $page_no"><a href="{getUrl('page',$page_no,'document_srl','')}">{$page_no}</a></li>
		<!--@end-->
		<li><a href="{getUrl('page',$page_navigation->last_page,'document_srl','')}" class="direction">{$lang->last_page} &raquo;</a></li>
	</ul>
</div>
<include target="./common_footer.html" />
